<template>
  <div>登录跳转中</div>
</template>

<script>
import defaultSettings from '@/settings'

console.log(defaultSettings)
export default {
  name: 'SsoLogin',
  data() {
    return {
      url: defaultSettings.oauth2.url,
      redirectUrl: defaultSettings.oauth2.redirectUrl,
      redirectHash: defaultSettings.oauth2.redirectHash,
      iframeWin: null
    }
  },
  computed: {
    loginUrl() {
      return this.url + '?redirectUrl=' + this.redirectUrl + '&redirectHash=' + this.redirectHash
    }
  },
  watch: {

  },
  mounted() {
  },
  created() {
    const redirect = this.$route.query.redirect

    if (redirect !== undefined && typeof redirect === 'string') {
      console.log(redirect)
      localStorage.setItem('loginSuccessRedirect', redirect)
    }

    window.location.href = this.loginUrl
  },
  methods: {
  }
}
</script>

<style scoped lang="scss">
  iframe {
    position: absolute;
    top: 0px;
    left: 0px;
    right: 0px;
    height: 100%;
    width: 100%;
  }
</style>
